import { StyleSheet, Image, View } from 'react-native'
import React, { useEffect } from 'react'
import icon_main_logo from '@/assets/images/icon_main_logo.png'
import { useNavigation } from '@react-navigation/native'
import { StackNavigationProp } from '@react-navigation/stack'

const Welcome = () => {
  const navigation = useNavigation<StackNavigationProp<any>>()
  useEffect(() => {
    setTimeout(() => {
      // 3s 后跳转到登录页面
      navigation.replace('Login')
    }, 3000)
  }, [])

  return (
    <View style={styles.root}>
      <Image source={icon_main_logo} style={styles.logo}></Image>
    </View>
  )
}

export default Welcome

const styles = StyleSheet.create({
  root: {
    width: '100%',
    height: '100%',
    alignItems: 'center',
    backgroundColor: '#fff'
  },
  logo: {
    resizeMode: 'contain',
    width: 200,
    marginTop: 200
  }
})
